DROP TABLE CRST_HZ_RELATIONSHIPS;

CREATE TABLE CRST_HZ_RELATIONSHIPS
(
  RELATIONSHIP_ID            NUMBER(15)         NOT NULL,
  SUBJECT_ID                 NUMBER(15)         NOT NULL,
  SUBJECT_TYPE               VARCHAR2(30 BYTE)  NOT NULL,
  SUBJECT_TABLE_NAME         VARCHAR2(30 BYTE)  NOT NULL,
  OBJECT_ID                  NUMBER(15)         NOT NULL,
  OBJECT_TYPE                VARCHAR2(30 BYTE)  NOT NULL,
  OBJECT_TABLE_NAME          VARCHAR2(30 BYTE)  NOT NULL,
  PARTY_ID                   NUMBER(15),
  RELATIONSHIP_CODE          VARCHAR2(30 BYTE)  NOT NULL,
  DIRECTIONAL_FLAG           VARCHAR2(1 BYTE)   NOT NULL,
  COMMENTS                   VARCHAR2(240 BYTE),
  START_DATE                 DATE               NOT NULL,
  END_DATE                   DATE,
  STATUS                     VARCHAR2(1 BYTE)   NOT NULL,
  CREATED_BY                 NUMBER(15)         NOT NULL,
  CREATION_DATE              DATE               NOT NULL,
  LAST_UPDATED_BY            NUMBER(15)         NOT NULL,
  LAST_UPDATE_DATE           DATE               NOT NULL,
  LAST_UPDATE_LOGIN          NUMBER(15),
  WH_UPDATE_DATE             DATE,
  REQUEST_ID                 NUMBER(15),
  PROGRAM_APPLICATION_ID     NUMBER(15),
  PROGRAM_ID                 NUMBER(15),
  PROGRAM_UPDATE_DATE        DATE,
  ATTRIBUTE_CATEGORY         VARCHAR2(30 BYTE),
  ATTRIBUTE1                 VARCHAR2(150 BYTE),
  ATTRIBUTE2                 VARCHAR2(150 BYTE),
  ATTRIBUTE3                 VARCHAR2(150 BYTE),
  ATTRIBUTE4                 VARCHAR2(150 BYTE),
  ATTRIBUTE5                 VARCHAR2(150 BYTE),
  ATTRIBUTE6                 VARCHAR2(150 BYTE),
  ATTRIBUTE7                 VARCHAR2(150 BYTE),
  ATTRIBUTE8                 VARCHAR2(150 BYTE),
  ATTRIBUTE9                 VARCHAR2(150 BYTE),
  ATTRIBUTE10                VARCHAR2(150 BYTE),
  ATTRIBUTE11                VARCHAR2(150 BYTE),
  ATTRIBUTE12                VARCHAR2(150 BYTE),
  ATTRIBUTE13                VARCHAR2(150 BYTE),
  ATTRIBUTE14                VARCHAR2(150 BYTE),
  ATTRIBUTE15                VARCHAR2(150 BYTE),
  ATTRIBUTE16                VARCHAR2(150 BYTE),
  ATTRIBUTE17                VARCHAR2(150 BYTE),
  ATTRIBUTE18                VARCHAR2(150 BYTE),
  ATTRIBUTE19                VARCHAR2(150 BYTE),
  ATTRIBUTE20                VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE_CATEGORY  VARCHAR2(30 BYTE),
  GLOBAL_ATTRIBUTE1          VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE2          VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE3          VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE4          VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE5          VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE6          VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE7          VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE8          VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE9          VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE10         VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE11         VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE12         VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE13         VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE14         VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE15         VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE16         VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE17         VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE18         VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE19         VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE20         VARCHAR2(150 BYTE),
  CONTENT_SOURCE_TYPE        VARCHAR2(30 BYTE)  NOT NULL,
  RELATIONSHIP_TYPE          VARCHAR2(30 BYTE)  NOT NULL,
  OBJECT_VERSION_NUMBER      NUMBER,
  CREATED_BY_MODULE          VARCHAR2(150 BYTE),
  APPLICATION_ID             NUMBER,
  ADDITIONAL_INFORMATION1    VARCHAR2(150 BYTE),
  ADDITIONAL_INFORMATION2    VARCHAR2(150 BYTE),
  ADDITIONAL_INFORMATION3    VARCHAR2(150 BYTE),
  ADDITIONAL_INFORMATION4    VARCHAR2(150 BYTE),
  ADDITIONAL_INFORMATION5    VARCHAR2(150 BYTE),
  ADDITIONAL_INFORMATION6    VARCHAR2(150 BYTE),
  ADDITIONAL_INFORMATION7    VARCHAR2(150 BYTE),
  ADDITIONAL_INFORMATION8    VARCHAR2(150 BYTE),
  ADDITIONAL_INFORMATION9    VARCHAR2(150 BYTE),
  ADDITIONAL_INFORMATION10   VARCHAR2(150 BYTE),
  ADDITIONAL_INFORMATION11   VARCHAR2(150 BYTE),
  ADDITIONAL_INFORMATION12   VARCHAR2(150 BYTE),
  ADDITIONAL_INFORMATION13   VARCHAR2(150 BYTE),
  ADDITIONAL_INFORMATION14   VARCHAR2(150 BYTE),
  ADDITIONAL_INFORMATION15   VARCHAR2(150 BYTE),
  ADDITIONAL_INFORMATION16   VARCHAR2(150 BYTE),
  ADDITIONAL_INFORMATION17   VARCHAR2(150 BYTE),
  ADDITIONAL_INFORMATION18   VARCHAR2(150 BYTE),
  ADDITIONAL_INFORMATION19   VARCHAR2(150 BYTE),
  ADDITIONAL_INFORMATION20   VARCHAR2(150 BYTE),
  ADDITIONAL_INFORMATION21   VARCHAR2(150 BYTE),
  ADDITIONAL_INFORMATION22   VARCHAR2(150 BYTE),
  ADDITIONAL_INFORMATION23   VARCHAR2(150 BYTE),
  ADDITIONAL_INFORMATION24   VARCHAR2(150 BYTE),
  ADDITIONAL_INFORMATION25   VARCHAR2(150 BYTE),
  ADDITIONAL_INFORMATION26   VARCHAR2(150 BYTE),
  ADDITIONAL_INFORMATION27   VARCHAR2(150 BYTE),
  ADDITIONAL_INFORMATION28   VARCHAR2(150 BYTE),
  ADDITIONAL_INFORMATION29   VARCHAR2(150 BYTE),
  ADDITIONAL_INFORMATION30   VARCHAR2(150 BYTE),
  DIRECTION_CODE             VARCHAR2(30 BYTE),
  PERCENTAGE_OWNERSHIP       NUMBER,
  ACTUAL_CONTENT_SOURCE      VARCHAR2(30 BYTE)  DEFAULT 'USER_ENTERED'        NOT NULL,
  RELATIONSHIP_ID_N          NUMBER(15) 
);
